Add a test for gdk_rgba_copy
authorMatthias Clasen <mclasen@redhat.com>
Sun, 8 Jan 2012 00:00:32 +0000 (19:00 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 8 Jan 2012 00:00:32 +0000 (19:00 -0500)
gdk/tests/gdk-color.c

index 3c3955a3cc3eae2e721c31a96dd4c79969605445..af69c20dcfdaa995355bab94ebccfc5087c923b2 100644 (file)
@@ -90,6 +90,23 @@ test_color_to_string (void)
   g_free (orig);
 }
 
+static void
+test_color_copy (void)
+{
+  GdkRGBA rgba;
+  GdkRGBA *out;
+
+  rgba.red = 0.0;
+  rgba.green = 0.1;
+  rgba.blue = 0.6;
+  rgba.alpha = 0.9;
+
+  out = gdk_rgba_copy (&rgba);
+  g_assert (gdk_rgba_equal (&rgba, out));
+
+  gdk_rgba_free (out);
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -97,6 +114,7 @@ main (int argc, char *argv[])
 
         g_test_add_func ("/color/parse", test_color_parse);
         g_test_add_func ("/color/to-string", test_color_to_string);
+        g_test_add_func ("/color/copy", test_color_copy);
 
         return g_test_run ();
 }